package com.damon.authority.dal.entity;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 权限系统中的操作日志数据项
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月01日 10:57
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "t_platform_oplog", catalog = "db_kylin_artwork")
public final class OperateLogEntry extends BaseEntry implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true)
    private Long id;

    @Column(name = "ip", length = 128)
    private String sourceIp;

    @Column(name = "user_id")
    private Long userId;

    @Column(length = 16)
    private String username;

    @Column(length = 32)
    private String operation;

    @Column(length = 512)
    private String uri;

    @Column private Long duration;

    @Column(columnDefinition = "TEXT")
    private String params;
}
